<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="FCK" uri="http://java.fckeditor.net" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="/xboard/css/common.css" rel="stylesheet" type="text/css">
<title>Xboard</title>
</head>
<script type="text/javascript" src="/xboard/common/check.js"></script>
<script type="text/javascript">
	function fn_add(){
		var obj = document.frm;
		var file = obj.userFile.value;
		obj.fileList[obj.fileList.length] = new Option(file,obj.fileList.length);
	}
</script>
<body>
<s:form action="./write.action" method="post" enctype="multipart/form-data" name="frm">
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<table width="780" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td align="center" style="padding:50px 0 15px 0; font-size:13px; font-weight:bold;">Xboard</td>
					</tr>
					<tr>
						<td align="left">
							<table width="780" cellpadding="0" cellspacing="0" style="border-collapse: collapse;" border="1" bordercolor="#878787">
								<tr height="28">
									<td width="150" class="w_text">이름 : </td>
									<td width="240"><input type="text" name="writer" class="i_style input1"></td>
									<td width="150" class="w_text">이메일 :</td>
									<td width="240"><input type="text" name="email" class="i_style input1"></td>
								</tr>
								<tr height="28">
									<td width="150" class="w_text">글제목:</td>
									<td width="480" colspan="3"><input type="text" name="subject" class="i_style input2"></td>
								</tr>
								<tr>
									<td width="150" class="w_text">내용:</td>
									<td colspan="3" height="500" align="center">
										<!-- <textarea name="content" class="textarea1"></textarea> -->
										<FCK:editor instanceName="content" toolbarSet="MyStyle" width="99%" height="500">
										</FCK:editor>
									</td>
								</tr>
								<tr height="28">
									<td width="150" class="w_text">비밀번호</td>
									<td colspan="3">
										<input id="userPass" type="password" class="i_style input1" name="pass" maxlength="8">
									</td>
								</tr>
								<tr height="28">
									<td width="150" class="w_text">첨부파일</td>
									<td colspan="3"><input id="userFile" type="file" name="userFile" ></td>
								</tr>
								<!-- <tr height="28">
									<td width="150" class="w_text">첨부파일</td>
									<td colspan="3">
									    <select name="fileList" size="5" class="i_style file_select"></select>
										<div class="file_div">
											<div class="file_hidden">
												<input id="userFile" type="file" name="userFile" class="file" onchange="fn_add()">
											</div>
											파일등록
										</div>
									</td>
								</tr> -->
							</table>
						</td>
					</tr>
					<tr>
						<td align="right">
							<table border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td style="padding-top: 10px;">
										<input class="b_style t_btn" type="button" value="글저장" onclick="fn_write();">
										<input class="b_style t_btn" style="margin-left: 5px;" type="button" value="글목록" onclick="javascript:document.location.href='./list.action'">
									</td>
								</tr>
							</table>
						</td>		
					</tr>
				</table>
			</td>
		</tr>
	</table>
	<s:if test="%{cmd == 'replay'}">
		<input type="hidden" name="cmd" value="replay">
		<input type="hidden" name="ref" value="<s:property value='ref'/>">
		<input type="hidden" name="step" value="<s:property value='step'/>">
		<input type="hidden" name="lev" value="<s:property value='lev'/>">
		<input type="hidden" name="pnum" value="<s:property value='pnum'/>">
	</s:if>
	<s:else>
		<input type="hidden" name="cmd" value="new">
	</s:else>
</s:form>
</body>
</html>

